import request from "@/request/request";
import requestMock from "@/request/requestMock";
// 获取三级列表
export function getCatList() {
    return request.get("/product/getBaseCategoryList")
}
// 请求轮播图List(Mock请求)
export function getBannerList() {
    return requestMock.get('/banner/list')
}
// 获取虚假楼层数据
export function getFoolList() {
    return requestMock.get('/floor/list')
}
// 根据搜索参数,获取搜索到的值
export function getSearchList(searchParams) {
    return request.post('/list', searchParams)
}
// 获取商品详情的数据
export function getGoodsSkuList(skuId) {
    return request.get(`/item/${skuId}`)
}
// 向购物车添加商品
export function addGoodscat(skuId, skuNum) {
    return request.post(`/cart/addToCart/${skuId}/${skuNum}`)
}
// 请求全部的购物车列表
export function getGoodList() {
    return request.get(`/cart/cartList`)
}
// 修改购物车的商品选中状态
export function changeIsChecked(skuId, isChecked) {
    return request.get(`/cart/checkCart/${skuId}/${isChecked}`)
}
// 删除购物车的商品
export function deleteCartGoods(skuId) {
    return request.delete(`/cart/deleteCart/${skuId}`)
}
export function goodsChangeAll(isChecked, skuIdList) {
    return request.post(`/cart/batchCheckCart/${isChecked}`, skuIdList)
}
// 修改购物车商品数量
export function changeGoodsNum(skuId, skuNum) {
    return request.post(`/cart/addToCart/${skuId}/${skuNum}`)
}
// 批量删除选中数据
export function deleteCartCheckGoods(skuIdList) {
    return request.delete(`/cart/batchDeleteCar`, skuIdList)
}
// 获取验证码
export function getSendCode(phone) {
    return request.get(`/user/passport/sendCode/${phone}`)
}
// 注册用户

export function reqUserRegister(UserInfo) {
    return request.post(`/user/passport/register`, UserInfo)
}
// 用户登录

export function reqUserLogin(UserInfo) {
    return request.post(`/user/passport/login`, UserInfo)
}
// 根据token获取用户信息
export function getUserInfo() {
    return request.get(`/user/passport/auth/getUserInfo`)
}
// 退出登录状态(使当前token失效)
export function reqLogOut() {
    return request.get(`/user/passport/logout`)
}
// 请求用户地址信息(mock)
export function getAddressList() {
    return requestMock.get('/address/list')
}
// 获取订单交易页信息
export function getTrade() {
    return request.get('/order/auth/trade')
}
// 获取订单交易页信息
export function submitOrder(tradeNo, tradeInfo) {
    return request.post(`/order/auth/submitOrder?tradeNo=${tradeNo}`, tradeInfo)
}
// 获取订单交易页信息
export function gitPayNative(orderId) {
    return request.get(`/payment/weixin/createNative/${orderId}`)
}
// 获取订单交易页信息
export function getPayState(orderId) {
    return request.get(`/payment/weixin/queryPayStatus/${orderId}`)
}
// 获取订单交易页信息
export function getOrderAuth(page, limit) {
    return request.get(`/order/auth/${page}/${limit}`)
}